//
//  UploadData.m
//  ActionsMemorandum
//
//  Created by _LJX on 2017/10/26.
//  Copyright © 2017年 _LJX. All rights reserved.
//

#import "UploadData.h"
#import "SingleModle.h"
@implementation UploadData
+(void)CreatStorageFile{
    NSFileManager *fileManager = [[NSFileManager alloc]init];
    NSString *pathDocuments = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
    NSString *createPath = [NSString stringWithFormat:@"%@/MemorandumData.plist",pathDocuments];
    if (![[NSFileManager defaultManager]fileExistsAtPath:createPath]) {
        [fileManager createFileAtPath:createPath contents:nil attributes:nil];//创建文件
        //        [fileManager createDirectoryAtPath:createPath withIntermediateDirectories:YES attributes:nil error:nil];//创建文件夹
        NSLog(@"创建成功");
    }else{
        NSLog(@"有这个文件了");
    }
    [SingleModle shareData].DataPath = createPath;
    NSLog(@"%@",createPath);
}

+(void)ReadData{
    [SingleModle shareData].DataCache = [NSArray arrayWithContentsOfFile:[SingleModle shareData].DataPath];
    NSLog(@"文件读取");
    
}


+(void)WriteData{
     [[SingleModle shareData].DataCache writeToFile:[SingleModle shareData].DataPath atomically:YES];
    NSLog(@"文件写入");
}

@end
